<?php

$this->load->helper('form');

foreach($query->result() as $row)
{
	$deleteText = form_open('admin/delete_dvd', array('class' => 'dvd_delete_form'))
	.form_hidden('dvd_id', $row->dvd_id)
	.form_submit('delete_dvd', 'Delete')
	.form_close();
	
	$this->table->add_row(
		'<img src="'.base_url().dvd_covers_path().'/'.$row->dvd_cover.'" style="width: 80px;">',
		$row->dvd_title,
		'&pound;'.$row->dvd_price,
		anchor('admin/update_dvd/'.$row->dvd_id, 'Update').$deleteText
	);
}

$tmpl = array(
	'table_open' => '<table class="center top dvds_table">'
);
$this->table->set_template($tmpl);

$this->table->set_heading('', 'Title', 'Price', 'Action');
echo $this->table->generate();